import React, { Component } from 'react'
import ThemeContext from './context/home-context'
import UserContext from './context/user-context'
export class HomeInfo extends Component {
  render() {
    const { color, size } = this.context
    return (
      <div>
        <UserContext.Consumer>
            {value=>{
                return <h2>{value.name}:{value.age}</h2>
            }}
        </UserContext.Consumer>
        {color}:{size}
      </div>
    )
  }
}
HomeInfo.contextType = ThemeContext

export default HomeInfo
